<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>构造函数</title>
	</head>

	<body>
		<script>
			function Flower(name, genera, area, uses) {
				this.name = name;
				this.genera = genera;
				this.area = area;
				this.uses = uses;
				this.showName = showName;
			}

			function showName() {
				alert(this.name);
			}
			var flowers1 = new Flower("长春花", "夹竹桃", "非洲", "观赏");
			flowers1.showName();
			var flowers2 = new Flower("曼陀罗花", "夹竹桃", "非洲", "观赏");
			flowers2.showName();
		</script>
	</body>

</html>